<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.homepage.*" %>
<%

	HashList code009	= CommonUtil.getCodeList("009");	//권한


	String s_init_date		= StringUtil.nvl(request.getParameter("s_init_date"), TODAY.substring(0,6));
	String s_user_name		= StringUtil.toHan(request.getParameter("s_user_name"));


	HashMap infos = new HashMap();
	infos.put("init_date",	s_init_date);


	HomePageDAO dao 	= new HomePageDAO();

	HashList list 	= new HashList();
	if (!"".equals(s_init_date)) {
		list = dao.selectVisitList(infos);
	}


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>조인하와이</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#list').find('tr').hover(
				function () { $(this).addClass("hover"); }
			  , function () { $(this).removeClass("hover"); }
			)
			.click(function(){
				//$('#hotel_id').val($(this).attr('hotel_id'));
				//$('#searchForm').attr('action', './hotelDetail.jsp');
				//$('#searchForm').submit();
			});
	});



	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/admin/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/admin/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>접속통계</h1>
				<p>홈 > 홈페이지관리 > <b>접속통계</b></p>
			</div>
			<div class="clear line_01"></div>

			<form id="searchForm" method="post" action="./visitList.jsp">
			<table cellpadding="0" cellspacing="0" class="table_01 mt15">
			<colgroup>
				<col width="100px" />
				<col  />
			</colgroup>
			<tr>
				<th><p>조회일</p></th>
				<td class="brx">
					<input type="text" name="s_init_date" id="s_init_date" value="<%= s_init_date %>" class="w120"/>
				</td>
			</tr>
			</table>

			<div class="mt10 mb10 r">
				<input type="image" src="/images/admin/btn_search.gif">
			</div>

			</form>

			<div class="search_result">검색결과 : <%= list.size() %>건</div>

		    <table cellpadding="0" cellspacing="0" class="table_03">
				<colgroup>
					<col width="200px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col/>
				</colgroup>
				<thead>
					<tr>
						<th><p>방문일</p></th>
						<th><p>방문수</p></th>
						<th><p>북마크</p></th>
						<th><p>네이버검색</p></th>
						<th><p>네이버지식인</p></th>
						<th><p>클릭수</p></th>
						<th><p></p></th>
					</tr>
				</thead>
				<tbody id="list">
			<%	for (int i = 0; i < list.size(); i++) { %>
					<tr>
						<td><%= StringUtil.nvl(list.get("init_date", i)).replace("Sun","일").replace("Mon","월").replace("Tue","화").replace("Wed","수").replace("Thu","목").replace("Fri","금").replace("Sat","토") %></td>
						<td><%= StringUtil.toPrice(list.get("visit", i)) %></td>
						<td><%= StringUtil.toPrice(list.get("bookmark", i)) %></td>
						<td><%= StringUtil.toPrice(list.get("naver_search", i)) %></td>
						<td><%= StringUtil.toPrice(list.get("naver_kin", i)) %></td>
						<td><%= StringUtil.toPrice(list.get("click", i)) %></td>
						<td></td>
					</tr>
			<%	} %>
				</tbody>
			</table>

			<div class="paging">

			</div>
		</div>
	</div>
</div>
</body>
</html>
